package com.zheng.russiaRec.view.components 
{
	import com.zheng.russiaRec.view.components.common.AM_Container;
	import com.zheng.russiaRec.view.components.common.MultiObjDisplay;
	
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	
	/**
	 * @describe  	rec
	 * @author  	Mr.zheng
	 * @website 	http://blog.sina.com.cn/zihua2007
	 * @time		2010-12-8 19:49
	 */
	public class UI_Rec extends MultiObjDisplay
	{
		public static const REC_NORMAL:String="rec_normal";
		public static const REC_SHOW:String="rec_show";
		public static const REC_AM_DISAPPEAR:String="rec_AmDisappear";
		
		public function UI_Rec(displayMc:MovieClip) 
		{
			super(displayMc);
			
			this.addStatus(REC_NORMAL,displayMc.recNormal);
			this.addStatus(REC_SHOW,displayMc.recShow);
			this.addStatus(REC_AM_DISAPPEAR, new AM_Container(displayMc.recAmDisappear as MovieClip));
			this.gotoStatus(REC_NORMAL);
		}
		
		override public function gotoStatus(statusName:String):void{
			super.gotoStatus(statusName);
			//如果该状态下的显示对象是动画，播放
			var currMc:DisplayObject=currDisplay as DisplayObject;
			if(currMc is AM_Container){
				AM_Container(currMc).play();
			}
		}
		
	}
	
}